public abstract class OperationFailureErrorException extends OperationFailureException implements IErrorException, IXMLMarshallable
abstract Java class is the base representation of an OperationFailureException that includes an error
(error code and arguments, comprehensive message, potential causes);
Consider the direct known subclasses: ServerErrorException,
InvalidCreationErrorException, and other error exceptions.
This class should be implemented by all the failure exceptions.
This class implements both the IXMLMarshallable and the XMLMarshallable Java interfaces.
Consider the known subclasses that represent an HCI operation exception; They are listed in this page.
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="cause" type="IErrorType" />
<xs:element name="causedBy" type="IErrorType" />
<xs:complexType name="IErrorType">
<xs:sequence>
<xs:element name="message" type="xs:string" />
<xs:choice>
<xs:element ref="string" />
<xs:element ref="date" />
<xs:element ref="number" />
<xs:element ref="boolean" />
</xs:choice>
</xs:sequence>
<xs:attribute name="module" type="xs:string" />
<xs:attribute name="code" type="xs:integer" />
</xs:complexType>
<xs:complexType name="OperationFailureError">
<xs:sequence>
<xs:element ref="cause" minOccurs="1" maxOccurs="1"/>
<xs:element ref="causedBy" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
| Modifier and Type | Field and Description |
|---|---|
static String |
CAUSE_TAG_NAME
Constant for the XML tag name of the
error embedded in the Operation Failure: "cause" |
static String |
CAUSED_BY_TAG_NAME
Constant for the XML tag name of the nested
IErrors errors embedded in the Operation Failure: "causedBy" |
static String |
MESSAGE_TAG_NAME
Constant for the XML tag name of the message describing the
error embedded in the Operation Failure: "message" |
| Constructor and Description |
|---|
OperationFailureErrorException()
Default constructor of the Operation Failure exception used to unmarshal its XML representation.
|
OperationFailureErrorException(IError error)
Builds the Operation Failure exception with the specified
IError. |
OperationFailureErrorException(IError error,
OperationFailureErrorException cause)
Builds the Operation Failure exception with the specified
IError and its triggering operation failure. |
OperationFailureErrorException(IError error,
Throwable cause)
Builds the Operation Failure exception with the specified
IError and its triggering exception. |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
IError |
getError()
|
String |
getMessage()
Returns the text message of the error in this exception.
|
abstract String |
getTagName()
Gets the XML tag name of the HCI model.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
marshalChildren(XMLOutputter output)
Gives an XML representation of the child objects of an object.
|
static void |
marshalIError(XMLOutputter output,
IError err)
|
void |
setError(IError error)
Sets the
error contained in this Operation Failure. |
static IError |
unmarshalIError(XMLMarshallable child)
|
getOperandReferenceaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitmarshalAttributesaddCharacterData, setAttributespublic static final String CAUSE_TAG_NAME
error embedded in the Operation Failure: "cause"public static final String CAUSED_BY_TAG_NAME
IErrors errors embedded in the Operation Failure: "causedBy"public static final String MESSAGE_TAG_NAME
error embedded in the Operation Failure: "message"public OperationFailureErrorException()
public OperationFailureErrorException(IError error)
IError.error - The IError to embed in the operation failurepublic OperationFailureErrorException(IError error, OperationFailureErrorException cause)
IError and its triggering operation failure.error - The IError to embed in the operation failurecause - The Operation Failure that has triggered the current Operation Failurepublic OperationFailureErrorException(IError error, Throwable cause)
IError and its triggering exception.error - The IError to embed in the operation failurecause - The exception that has triggered the current Operation Failurepublic String getMessage()
getMessage in class Throwablepublic IError getError()
IErrorExceptiongetError in interface IErrorExceptionerror associated in this exceptionpublic void setError(IError error)
error contained in this Operation Failure.error - The IError to embed in this operation failurepublic abstract String getTagName()
public final void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface IXMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic void marshalChildren(XMLOutputter output)
IXMLMarshallablemarshalChildren in interface IXMLMarshallableoutput - The XML output to marshal the child objects intopublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic static final void marshalIError(XMLOutputter output, IError err)
output - The output to marshal the error intoerr - The error to marshalpublic static final IError unmarshalIError(XMLMarshallable child)
child - The element to read the error from